pgtype: quote text range bounds - #2647
Open
sueun-dev wants to merge 1 commit into
Open
Conversation
Signed-off-by: Sueun Cho <sueun.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RangeCodecappends text bounds without quoting them. For a custom range with a text subtype, an empty string becomes an unbounded endpoint, a comma or quote produces a malformed range literal, and a backslash can disappear from the bound PostgreSQL reads.Quote bounds containing range syntax and escape embedded quotes and backslashes with the existing quoting helper. Binary encoding is unchanged. The tests use a real PostgreSQL text range, check both endpoints and buffer reuse, and include plain text, whitespace and braces as controls.
Tested with Go 1.25.13 and PostgreSQL 18.6 on Linux arm64:
Both regression tests fail on the base commit and pass with this change. Optional authentication, TLS and PgBouncer tests were not configured.
go vetand golangci-lint 2.13.2 report existing unkeyed test literals and formatting findings, reproduced on the base tree as well.This is an AI proposal produced with Codex. The task was to investigate a held range-encoding defect, reproduce it against PostgreSQL, and prepare a minimal fix with regression and broader tests. It has not had human code review.